import Vue from 'vue'
import request from '@/itsoftUI/utils/request'
import qs from "qs"
const baseUrl = Vue.prototype.$itsoftUI.config.serviceUrl + "/repair"

//工作台api
export const visitCommentApi = {
    List: function (pageIndex, pageSize, searchValue) {
        const data = {
            pageIndex,
            pageSize,
            searchValue
        }
        return request({
            url: baseUrl + '/visitComment/visitList',
            method: 'post',
            data: qs.stringify(data)
        })
    },
    //返修状态
    StatusList: function () {
        const data = {

        }
        return request({
            url: baseUrl + '/visitComment/statusList',
            method: 'post',
            data: qs.stringify(data)
        })
    },
    //回访 保存
    Save: function (data) {
        const config = {
            headers: {
                'Content-Type': 'application/json;charset=utf-8'
            },
        }
        return request.post(baseUrl + "/visitComment/save", data, config)
    },
    //回访 保存
    visitSave: function (data) {
        const config = {
            headers: {
                'Content-Type': 'application/json;charset=utf-8'
            },
        }
        return request.post(baseUrl + "/visitEvaluateUser/save", data, config)
    },

    //回访 批量保存
    BatchVisit: function (common, content, repairIds) {
        const data = {
            common,
            content,
            repairIds
        }
        return request({
            url: baseUrl + '/visitComment/batchVisit',
            method: 'post',
            data: qs.stringify(data)
        })
    },
    //回访 返修
    AfterRepair: function (repairIds, status, source) {
        const data = {
            repairIds,
            status,
            source
        }
        return request({
            url: baseUrl + '/visitComment/afterRepair',
            method: 'post',
            data: qs.stringify(data)
        })
    },
}